package zmwxapplet

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/app/dao"
	"yundian/internel/app/helper"
	"yundian/internel/app/models/logs"
	"yundian/internel/pkg/dingo"
	. "yundian/internel/pkg/dingo/result"
)

// HandleInsertBluetoothRechargeLog 蓝牙使用日志
func HandleInsertBluetoothRechargeLog(ctx *gin.Context) {
	userId, _ := helper.GetUserIdFromCtx(ctx)

	param := &logs.BluetoothRechargeLogDb{}
	dingo.ErrorIf(ctx.ShouldBindJSON(param)).Unwrap()
	param.MemberId = userId

	Response(ctx)("", CodeSuccess, dao.NewLogsDao().InsertBluetoothRechargeLog(param).Err == nil)(OK)
}
